home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
sjcsfo.zip
/
PTBEDIT.TXT
< prev
next >
Wrap
Text File
|
1992-11-24
|
7KB
|
166 lines
FIRST DRAFT OF A TEXT ON EDITING .TXT FILES MADE WITH TOOLBOX
Some of the suggestions below have been implemented in
SJCSFO.TXT. To see the"original" of that text, simply make up a
flight plan with Flight Planner and run it through ToolBox.
_____________________________________________
On editing .TXTs made with Robert Mackay's ToolBox
One of the nice things about Robert Mackay's Pilot's ToolBox is
the possibility of editing the .TXT files produced by the AAF
Factory module and changing them before compiling with AAF.EXE
(AAF YOURFILE.TXT YOURFILE.ADV). ToolBox .TXT files are straight
ASCII, and can therefore be edited with any word processor which
can handle such texts. It will be helpful if it has Search and
Search/Replace functions.
Here are a few suggestions:
First thing to do is to find the proper ground, tower, and
departure/approach frequencies for the airports, and substitute
them both in the messages and in the appropriate IF COM()'s. Get
these from the Airport and Facilties Directories, or from IAPs.
And you might have an improvement for the Center frequency.
Airport names in the original .FPD from which the .PLN was made,
in turn used by the ToolBox, can only be a certain number of
characters long, and therefore they will be truncated in the .TXT
file (e. g., "Interna" for "International". These are easily
edited.
I myself always eliminate the SETPOSITION line, and set up a mode
which gets me in the right position for the flight. You can thus
load this mode, and then load the corresponding adventure with
the proper choice in your Adventure menu (option 3). Same name,
of course, but not extension.
I also stick in other PRINT lines, such as giving the frequencies
of VORs when they are not otherwise provided. And of course you
can edit any PRINT statement, or omit ones you don't think are
appropriate.
You are *not* bound to take off from the runway provided by your
Flight Planner plan. ToolBox picks the takekoff runway at random
from those specified in the .FPD file. You can change this -- in
the relevant PRINT statements, and in the IF HEADING(X,Y) checks
for departure from proper runway (LOOP2B).
Landing runways in ToolBox are either an ILS runway, or a runway
chosen at random (in the case of two or more ILS runways, again a
random choice). You can also change that *landing* runway, but if
you do this, you also have to change the bearings and directions
of turns for downwind, base, and final, and this is a little
tricky -- some variables have to be changed for the automatic
pilot, too (following lines beginning "SETVAR(M,xxxx)", where
xxxx is the new heading). Some experimentation will be necessary.
The toolbox depends on the information in your .FPD being
correct. If not, you'll get screwy results in the .ADV. For
example, I note that BDL (Bradley) has *no* runways in SD-12.FPD!
Edit it. This is also the case if you don't have the right
runways, ILS frequencies, etc., not to mention wrong FS
coordinates.
In some of my adventures I like to remind myself that a certain
scenery disk and certain ASD scenery is required. There is a
simple routine to do this:
reminder:
PRINT "SD-12 and MASBOS12.SC1 required - acknowledge with 'x'"
if key("x")
goto OPTIONS
endif
goto reminder
Put this in before the OPTIONS loop in the .TXT file.
Other fine tuning is a little more complicated, and often depends
on your knowledge of the basic structure of the .TXT file. For
example, if you find that you're too close for Approach's
instruction to turn for downwind, look for a preceding IF
CYLINDER(x,y,nn,nnn) statement. X and Y there are the FS
coordinates of the point you're heading for; nn is usually 0, and
nnn is the one you might want to change. Increasing nnn will make
the command pop up earlier, decreasing later. (See AAF
documentation for such things.)
Want a subroutine to do something special, such as VIEW a .PCX
file of your approach plate? Write a new subroutine and put a
GOSUB VIEWIAP in every loop where you want this to be active
(there are several such GOSUBs in the loops of the basic .TXT
already). In that case your subroutine might read:
VIEWIAP:
if key("7")
VIEW(10,"MYIAP.PCX")
endif
RETURN
Whenever this subroutine is called, if the user hits "7",
MYIAP.PCX will appear on the screen for 10 seconds.
(Note: indentation of commands, as in the above, is not really
necessary for AAF-BASIC -- it just makes it easier to read and
understand.)
Writing whole new loops to do something not otherwise provided
for is a tricky business, but not impossible. Simply follow the
structure of the basic .TXT, write your loops, and be sure they
are called by the next previous loop and in turn call the next
following loop.
For example, you might want to put in a new loop which will check
your position over against the location and altitude of the FAF
(final approach fix) for your destination runway, in the case of
an ILS approach. One should be able to handle this with the IF
GSLOPE(x,y) command in AAF-BASIC, but at the moment this does not
seem to be working.
___________________
Structure of .TXT files
Almost all AAF .TXT files are a series of "loops", some of which
themselves contain other loops, and subroutines. You can think of
loops as phases or legs of your trip, and subroutines as things
you do from time to time.
Each loop begins with a label (LOOP:), and you enter such a loop
with a command such as GOTO LOOP. Subroutines also have labels,
and are entered with GOSUB WHATEVER. Subroutines conclude with
the command RETURN.
Each loop looks for a certain condition to be fulfilled
(altitude, setting of nav radios, distance from a certain point,
value of a certain variable, etc.). Then a command is given [PLAY
"MYVOC.VOC", PRINT "WE FULFILLED THE CONDITION", SETVAR(X,1),
PRINTVAR(x,"Your altitude is: "), VIEW(10,"MYPCX.PCX")]. Usually
after such a command or series of commands is issued you break
out of the current loop with GOTO NEXTLOOP.
Most loops in .TXT files produced by the ToolBox have another
subloop inside (LOOP1A, LOOP2A, etc.). This allows one to hit "R"
at any point and go back one loop to repeat the PLAY or PRINT
there, and proceed.
The conditions which must be fulfilled before a command is issued
can be either/or, both/and, etc. (Boolean logic). AAF-BASIC is
rather primitive, and these require some long programming.
Good programmers, like Robert Mackay, will provide their BASIC
scripts with comments, usually lines beginning ;. In ToolBox .TXT
files, for example, there is an explanation of the function of a
loop at the top of each, or at least a note on what's happening
(;Waiting for clearance). Note also that Robert has at the
beginning a series of ; lines with names of variables and their
function. If you write something new, be sure not to use these
variables -- that way lies disaster. Also be sure not to use
keypresses which are otherwise used in FS, and that's a problem:
there aren't very many of them left over. And several are already
used by the ToolBox .TXT file.